package com.wzh.ojbackendserviceclient.service;

import com.wzh.ojCommon.constant.SystemNameConstant;
import com.wzh.ojModel.model.entity.Question;
import com.wzh.ojModel.model.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wzh
 */

@FeignClient(name = SystemNameConstant.OJ_BACKEND_QUESTION_SERVICE,path = "/api/question/inner")
public interface QuestionFeignClient {

 /**
  * 根据id获取题目
  * @param questionId
  * @return
  */
 @GetMapping("/get/id")
 Question getQuestionById(@RequestParam("questionId") long questionId);

 /**
  * 根据id获取提交记录
  * @param questionSubmitId
  * @return
  */
 @GetMapping("/question_submit/get/id")
 QuestionSubmit getQuestionSubmitById(@RequestParam("questionId") long questionSubmitId);

 /**
  * 更新题目的提交状态
  * @param questionSubmit
  * @return
  */
 @PostMapping("/question_submit/update")
 boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);

}
